package com.amazon.operations;

import java.util.ArrayList;

/**
 *
 * @author Salman Noor, Shcool of Electrical and Information Engineering
 * @Copyright: Wits University 2013 - All Rights Reserved
 * @email salmannoor74415@gmail.com
 * @License BSD License (http://www.linfo.org/bsdlicense.html)
 */
public class average extends Operation {

    @Override
    public void setParameters(ArrayList<Integer> parameters) {
        super.parameters = parameters;
    }

    @Override
    public int findResult() {
        sum s = new sum();
        s.setParameters(super.parameters);
        if (super.parameters.size()<= 0){
            return 0;
        }else{
          return s.findResult()/super.parameters.size();  
        }
        
    }

}
